package edu.uc.labs.MobilePrinting.GUI;

import java.io.File;
import javax.swing.UIManager;
import org.apache.log4j.Logger;
import edu.uc.labs.MobilePrinting.Configurator;

/**
 * 
 * @author Matt Silbernagel
 */
public class PreferencesPanel extends javax.swing.JPanel {



	/** Creates new form NewJPanel */
	public PreferencesPanel() {
		initComponents();
	}

	private void initComponents() {

		generalTabbedPane = new javax.swing.JTabbedPane();
		jPanel3 = new javax.swing.JPanel();
		jLabel5 = new javax.swing.JLabel();
		jTextField1 = new javax.swing.JTextField();
		jSeparator4 = new javax.swing.JSeparator();
		jLabel6 = new javax.swing.JLabel();
		jTextField2 = new javax.swing.JTextField();
		jSeparator5 = new javax.swing.JSeparator();
		jLabel7 = new javax.swing.JLabel();
		logComboBox = new javax.swing.JComboBox();
		jPanel1 = new javax.swing.JPanel();
		jPanel2 = new javax.swing.JPanel();
		usageCheckBox = new javax.swing.JCheckBox();
		updateCheckBox = new javax.swing.JCheckBox();
		jSeparator2 = new javax.swing.JSeparator();
		startCheckBox = new javax.swing.JCheckBox();
		deletePrinterCheckBox = new javax.swing.JCheckBox();
		startLabel = new javax.swing.JLabel();
		jSeparator1 = new javax.swing.JSeparator();
		deleteLabel = new javax.swing.JLabel();
		updateLabel = new javax.swing.JLabel();
		jSeparator3 = new javax.swing.JSeparator();
		usageLabel = new javax.swing.JLabel();
		
		
		jLabel5.setLabelFor(jTextField1);
		jLabel5.setText("Configuration Server");
		jLabel6.setLabelFor(jTextField2);
		jLabel6.setText("Printer Name");
		jLabel7.setText("Log Level");
		logComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"Debug", "Informational", "Error" }));

		javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(
				jPanel3);
		jPanel3.setLayout(jPanel3Layout);
		jPanel3Layout
				.setHorizontalGroup(jPanel3Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel3Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												jPanel3Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(
																jSeparator5,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																464,
																Short.MAX_VALUE)
														.addComponent(
																jSeparator4,
																javax.swing.GroupLayout.Alignment.TRAILING,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																464,
																Short.MAX_VALUE)
														.addComponent(
																jTextField1,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																377,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(jLabel5)
														.addComponent(jLabel6)
														.addComponent(
																jTextField2,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																377,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(jLabel7)
														.addComponent(
																logComboBox,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																377,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addContainerGap()));
		jPanel3Layout
				.setVerticalGroup(jPanel3Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel3Layout
										.createSequentialGroup()
										.addGap(30, 30, 30)
										.addComponent(jLabel5)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jTextField1,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addGap(18, 18, 18)
										.addComponent(
												jSeparator4,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												10,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addGap(18, 18, 18)
										.addComponent(jLabel6)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jTextField2,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addGap(18, 18, 18)
										.addComponent(
												jSeparator5,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addGap(18, 18, 18)
										.addComponent(jLabel7)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												logComboBox,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
												26, Short.MAX_VALUE)

										.addContainerGap()));
		generalTabbedPane.addTab("General Preferences", jPanel1);
		generalTabbedPane.addTab("Advanced Preferences", jPanel3);

		usageCheckBox.setText("Send Usage Data");
		usageCheckBox.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				usageCheckBoxActionPerformed(evt);
			}
		});

		updateCheckBox.setText("Auto Update");
		updateCheckBox.setToolTipText("Enable Automatic Updating\n");

		startCheckBox.setText("Start at Login");
		startCheckBox
				.setToolTipText("Check to start the application when the computer starts");
		startCheckBox.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				startCheckBoxActionPerformed(evt);
			}
		});

		deletePrinterCheckBox.setText("Delete Printer on Exit");
		deletePrinterCheckBox
				.setToolTipText("Check to uninstall printer when the application is exited");
		deletePrinterCheckBox.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				deletePrinterCheckBoxActionPerformed(evt);
			}
		});

		startLabel.setFont(new java.awt.Font("DejaVu Sans", 3, 12)); // NOI18N
		startLabel.setLabelFor(startCheckBox);
		startLabel
				.setText("Check to start the application when the computer starts");

		// jSeparator1.setForeground(new java.awt.Color(8, 7, 2));

		deleteLabel.setFont(new java.awt.Font("DejaVu Sans", 3, 12)); // NOI18N
		deleteLabel.setLabelFor(deletePrinterCheckBox);
		deleteLabel
				.setText("Check to uninstall printer when the application is exited");
		deleteLabel.setToolTipText("NULL");
		deleteLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);

		updateLabel.setFont(new java.awt.Font("DejaVu Sans", 3, 12));
		updateLabel.setLabelFor(updateCheckBox);
		updateLabel.setText("Enable Automatic Updating");

		usageLabel.setFont(new java.awt.Font("DejaVu Sans", 3, 12));
		usageLabel.setLabelFor(usageCheckBox);
		usageLabel
				.setText("Send data to the developers to assist in future development");
		usageLabel
				.setToolTipText("Send data to the developers that might help in future development");

		// jButton3.setText("Restore Defaults");

		javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(
				jPanel2);
		jPanel2.setLayout(jPanel2Layout);
		jPanel2Layout
				.setHorizontalGroup(jPanel2Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel2Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												jPanel2Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.LEADING)
																						.addComponent(
																								startCheckBox)
																						.addComponent(
																								deletePrinterCheckBox)
																						.addComponent(
																								usageCheckBox,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								154,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								updateCheckBox,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								114,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								jSeparator3,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								489,
																								Short.MAX_VALUE)
																						.addGroup(
																								jPanel2Layout
																										.createSequentialGroup()
																										.addGap(
																												12,
																												12,
																												12)
																										.addComponent(
																												updateLabel,
																												javax.swing.GroupLayout.PREFERRED_SIZE,
																												403,
																												javax.swing.GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																												74,
																												javax.swing.GroupLayout.PREFERRED_SIZE))
																						.addComponent(
																								jSeparator2,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								489,
																								Short.MAX_VALUE)
																						.addGroup(
																								jPanel2Layout
																										.createSequentialGroup()
																										.addGap(
																												12,
																												12,
																												12)
																										.addComponent(
																												startLabel)
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																												77,
																												javax.swing.GroupLayout.PREFERRED_SIZE))
																						.addComponent(
																								jSeparator1,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								489,
																								Short.MAX_VALUE)
																						.addGroup(
																								jPanel2Layout
																										.createSequentialGroup()
																										.addGap(
																												12,
																												12,
																												12)
																										.addComponent(
																												deleteLabel,
																												javax.swing.GroupLayout.PREFERRED_SIZE,
																												417,
																												javax.swing.GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																												60,
																												javax.swing.GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								jPanel2Layout
																										.createSequentialGroup()
																										.addGap(
																												12,
																												12,
																												12)
																										.addComponent(
																												usageLabel)))
																		.addContainerGap())
														.addGroup(
																javax.swing.GroupLayout.Alignment.TRAILING,
																jPanel2Layout
																		.createSequentialGroup()

																		.addGap(
																				37,
																				37,
																				37)))));
		jPanel2Layout
				.setVerticalGroup(jPanel2Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel2Layout
										.createSequentialGroup()
										.addContainerGap()
										.addComponent(
												startCheckBox,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												22,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(startLabel)
										.addGap(13, 13, 13)
										.addComponent(
												jSeparator1,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(deletePrinterCheckBox)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(deleteLabel)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jSeparator2,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(updateCheckBox)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(updateLabel)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jSeparator3,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(usageCheckBox)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(usageLabel).addGap(29, 29,
												29)

										.addContainerGap(45, Short.MAX_VALUE)));

		javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(
				jPanel1);
		jPanel1.setLayout(jPanel1Layout);
		jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel1Layout.createSequentialGroup().addContainerGap()
						.addComponent(jPanel2,
								javax.swing.GroupLayout.PREFERRED_SIZE,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));
		jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel1Layout.createSequentialGroup().addContainerGap()
						.addComponent(jPanel2,
								javax.swing.GroupLayout.PREFERRED_SIZE,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				javax.swing.GroupLayout.Alignment.TRAILING,
				layout.createSequentialGroup().addContainerGap(371,
						Short.MAX_VALUE).addGap(18, 18, 18).addContainerGap())
				.addComponent(generalTabbedPane,
						javax.swing.GroupLayout.PREFERRED_SIZE,
						javax.swing.GroupLayout.DEFAULT_SIZE,
						javax.swing.GroupLayout.PREFERRED_SIZE));
		layout
				.setVerticalGroup(layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								layout
										.createSequentialGroup()
										.addComponent(
												generalTabbedPane,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												362,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												layout
														.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE))
										.addContainerGap(19, Short.MAX_VALUE)));
	}

	private void deletePrinterCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	private void startCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	private void usageCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	public static void createAndShowGUI() {
		UIManager.put("swing.boldMetal", Boolean.FALSE);
		// JFrame.setDefaultLookAndFeelDecorated(false);

		// Create and set up the window.
		PreferencesFrame frame = new PreferencesFrame();

		// Add content to the window.
		frame.add(new PreferencesPanel());

		// Display the window.
		frame.pack();
		frame.setVisible(true);
	}

	// Variables declaration - do not modify
	private javax.swing.JCheckBox deletePrinterCheckBox;
	private javax.swing.JCheckBox startCheckBox;
	private javax.swing.JCheckBox updateCheckBox;
	private javax.swing.JCheckBox usageCheckBox;
	private javax.swing.JComboBox logComboBox;
	private javax.swing.JLabel deleteLabel;
	private javax.swing.JLabel startLabel;
	private javax.swing.JLabel updateLabel;
	private javax.swing.JLabel usageLabel;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JLabel jLabel6;
	private javax.swing.JLabel jLabel7;
	private javax.swing.JPanel jPanel1;
	private javax.swing.JPanel jPanel2;
	private javax.swing.JPanel jPanel3;
	private javax.swing.JSeparator jSeparator1;
	private javax.swing.JSeparator jSeparator2;
	private javax.swing.JSeparator jSeparator3;
	private javax.swing.JSeparator jSeparator4;
	private javax.swing.JSeparator jSeparator5;
	private javax.swing.JTabbedPane generalTabbedPane;
	private javax.swing.JTextField jTextField1;
	private javax.swing.JTextField jTextField2;
	
	private static final long serialVersionUID = 7883092810671401781L;
	private static Logger logger = Configurator.LOGGER;
	// End of variables declaration

}
